package com.lucfzy;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MyController {

    @Autowired
    GoodInfoMapper goodInfoMapper;

    @GetMapping("/queryAll")
    public PageInfo queryAll() {
        MyArrayList<String> stringList = new MyArrayList<>();
        stringList.add("dddd");
        PageHelper.startPage(1,3);
        Page<GoodInfo> result = goodInfoMapper.findAll();
        Page<GoodInfo> result1 = goodInfoMapper.findAll();
        PageInfo<GoodInfo> of = PageInfo.of(result);
        return of;
    }

    @GetMapping("insert")
    public void insert() {
        GoodInfo goodInfo = new GoodInfo();
        goodInfo.setQuantity(666);
        goodInfo.setSkuCode("123456");
        goodInfoMapper.insert(goodInfo);
    }

    public String print(String... str) {
        return "ok";
    }

}
